import grails.test.*

class SchoolInfoTests extends GrailsUnitTestCase {
    protected void setUp() {
        super.setUp()
    }

    protected void tearDown() {
        super.tearDown()
    }

    void testSomething() {
        def school = School.build()
        school.save()

        def control = new SchoolInfoController()
        control.params.name = 'name'
        control.params.description = 'description'
        control.session.school = school

        control.save()

        assertEquals '/schoolInfo/list' , control.response.redirectedUrl
        
        assertEquals  1 , SchoolInfo.countBySchool(school)

        def schoolInfo = SchoolInfo.findBySchool(school)
        assertNotNull schoolInfo

        school = School.get(school.id)
        assertNotNull school.schoolInfo
    }
}
